package com.xdf.xzymanagementsystem.enums;

/**
 * @author chanchaw
 * @create 2023-06-18 11:01
 */
public enum BillTypeEnum {
    HALF_PRODUCT_ENTER_WAREHOUSE(0,"BBPRK","jk","半成品入库"),
    AUDITED(1,"已审核","","已审核"),
    ;

    private int index;
    private String flag;
    private String storageId;
    private String desc;

    public String getStorageId() {
        return storageId;
    }

    public void setStorageId(String storageId) {
        this.storageId = storageId;
    }

    public int getIndex() {
        return index;
    }

    public void setIndex(int index) {
        this.index = index;
    }

    public String getFlag() {
        return flag;
    }

    public void setFlag(String flag) {
        this.flag = flag;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    BillTypeEnum(int index,String flag,String storageId, String desc) {
        this.index = index;
        this.flag = flag;
        this.desc = desc;
        this.storageId = storageId;
    }

    // 根据索引返回枚举值
    static BillTypeEnum of(int index){
        for(BillTypeEnum item:BillTypeEnum.values()){
            if(item.getIndex() == index) return item;
        }
        return null;
    }
}
